package com.supermap.ar.unity.player;

import android.content.Context;
import android.view.SurfaceView;
import android.view.View;

import com.unity3d.player.IUnityPlayerLifecycleEvents;
import com.unity3d.player.UnityPlayer;

/**
 * 背景场景UnityPlayer
 */
public class BackUnityPlayer extends UnityPlayer {
    public BackUnityPlayer(Context context) {
        super(context);
    }

    public BackUnityPlayer(Context context, IUnityPlayerLifecycleEvents iUnityPlayerLifecycleEvents) {
        super(context, iUnityPlayerLifecycleEvents);
    }

    @Override
    public void addView(View child) {
        if (child instanceof SurfaceView){
            ((SurfaceView) child).setZOrderOnTop(false);
        }
        super.addView(child);
    }
}
